package actions;

//~--- non-JDK imports --------------------------------------------------------

import beans.*;

import client.TopicsPosts;

import dto.Sections;
import dto.Topics;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

//~--- JDK imports ------------------------------------------------------------


import java.math.BigInteger;

import java.util.Vector;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class InsideSection extends org.apache.struts.action.Action {
    TopicsPosts      posts;
    Vector<Sections> sec;
    Vector<Topics>   topic;

    public InsideSection() {
        posts = new TopicsPosts();
    }

    
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
           ActionForward forward=new ActionForward();
          
       Sections section=new Sections(); 
       Integer secId=new Integer(request.getParameter("section"));
       section.setSectionid(secId);
       posts.getInsideSection(section);
       sec=posts.getInnerSections();
       topic=posts.getInnerTopics();
       
       if(sec.size() != 0 || topic.size() != 0)
       {
           
          ((DisplayTopicActionFormBean)form).setSec(sec);
          ((DisplayTopicActionFormBean)form).setTopics(topic);
         
          forward=mapping.findForward("done");
       }
      
       return forward;
    }
//=======
//>>>>>>> .r38

   
}


//~ Formatted by Jindent --- http://www.jindent.com
